﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DomainModel.Entities.Task>" %>

<% if(ViewData["InsertMode"] == "inlist"){  %>
    <li class="task <%= Model.IsComplete == true ? "complete" : "" %>" id="task-id-<%= Model.Id %>">
<% }  %>
    <div class="sortable-cont">
        <span class="sortable">sortable</span>    
    </div>
    <div class="checkbox">
        <% if(!Model.IsComplete) {%>
    
            <%= Ajax.SpanActionLink("task-checkbox", 
                    "task-checkbox", 
                    "TaskComplete", 
                    new {id = Model.Id}, 
                    new AjaxOptions { UpdateTargetId = "task-id-" + Model.Id})%>
    
        <% } else {%>
    
            <%= Ajax.SpanActionLink("task-checkbox", 
                    "task-checkbox-completed", 
                    "TaskComplete", 
                    new {id = Model.Id}, 
                    new AjaxOptions { UpdateTargetId = "task-id-" + Model.Id })%>
    
        <% } %>

    </div>
    
    <div class="task-content">
        <a href="#" class="task-details-link"><%= Model.Name %></a>
        <% if(!string.IsNullOrEmpty(Model.Description)) { %>
            <span class="description-ico">description</span> 
        <% } %>
    </div>
    <ul class="task-actions">
        <li>
            <% if (Model.DateDue != null) {%>
                <span class="float-right task-date-status <%Html.RenderAction("GetDateStatus","Task", new {date = Model.DateDue}); %>">
                    <%Html.RenderAction("GetDateTitle", "Task", new {date = Model.DateDue}); %>&nbsp;&nbsp;
                </span>        
            <% } %>
                
        </li>
        <li><a id="edit-task-<%= Model.Id %>" class="edit-task-link" href="#edit-task-form" name="edit-task">&nbsp;</a></li>
        <li>
            <a class="delete-task">&nbsp;</a>
        </li>
        <li>
            <a href="#" class="<%= Model.Flagged ? "flag" : "noflag"%> flagged-task">&nbsp;</a>
        </li>
    </ul>


<% if(ViewData["InsertMode"] == "inlist"){  %>
    </li>
<% } %>
<script type="text/javascript">
    


</script>

